Route Processing Method, Device, and System

ABSTRACT

A route processing method includes obtaining, by a first network device, a flow effective time parameter and a route related to the flow effective time parameter, processing, by the first network device in the specified time interval, service traffic corresponding to the route related to the flow effective time parameter, generating a route control message, where the route control message carries the flow effective time parameter and the route, and sending, by the first network device, the route control message to a second network device.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/866,080 filed on Jan. 9, 2018, which is a continuation ofInternational Patent Application No. PCT/CN2016/087306 filed on Jun. 27,2016, which claims priority to Chinese Patent Application No.201510675200.1 filed on Oct. 16, 2015. All of the aforementioned patentapplications are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to a route processing method, a device, and a system.

BACKGROUND

Nowadays, network applications are developing toward refined management.For example, a user expects to control particular traffic in a specifiedtime period. In an example, to ensure reliable bandwidth of videotransmission in prime time at night, a network operator expects to limitdata traffic of a common user who uses an Internet access service anddoes not limit data traffic in other time periods. To achieve thisobjective, a service traffic control policy that is effective in limitedtime needs to be deployed.

An effective time period of service traffic may be controlled bydeploying an access control list (ACL) rule on a router. However, in amulti-router application scenario, an ACL rule needs to be deployed oneach router. Configuration processes are complex and error-prone.Especially, all routers at a network edge need to take a joint action(such as in an anti-distributed denial of service (Anti-DDOS) attackscenario) in some service traffic control scenarios. This furtherincreases configuration workload.

Furthermore, existing routing protocols do not support a limited-timeeffective feature. For example, the Border Gateway Protocol (BGP) is adynamic routing protocol between autonomous systems (ASs), and supportsdissemination of Internet Protocol (IP) routes, virtual private network(VPN) routes, and the BGP Flow Specification (FlowSpec). The BGP doesnot support setting of an effective time period, and cannot implement ajoint action (such as synchronously becoming effective, and becominginvalid during idle time) of multiple routers in a network. Therefore,the existing routing protocols cannot meet a limited-time effectiverequirement for the traffic control policy.

SUMMARY

In view of this, embodiments of this application provide a routeprocessing method, a device, and a system in order to resolve problemsthat limited-time effective information of multiple network devicescannot be disseminated, and a limited-time effective requirement for atraffic control policy cannot be met in a service traffic controlscenario with the multiple network devices.

Technical solutions provided by the embodiments of this application areas follows.

According to a first aspect, a route processing method is provided, andthe method includes obtaining, by a first network device, a floweffective time parameter and a route related to the flow effective timeparameter, where the flow effective time parameter includes a start timevalue and a duration value, and the flow effective time parameter isused to indicate that the route related to the flow effective timeparameter is effective in a time interval specified by the floweffective time parameter, processing, by the first network device in thespecified time interval, service traffic corresponding to the routerelated to the flow effective time parameter, and generating a routecontrol message, where the route control message carries the floweffective time parameter and the route related to the flow effectivetime parameter, and sending, by the first network device, the routecontrol message to a second network device.

Optionally, the first network device receives the flow effective timeparameter and the route related to the flow effective time parameterfrom a management device.

Optionally, the flow effective time parameter further includes a starttime type, where the start time type is immediate, delayed, orscheduled, and a start moment of the specified time interval is a momentat which the first network device starts processing the route controlmessage when the start time type is immediate, the flow effective timeparameter further includes a delay value, and a start moment of thespecified time interval is the start time value plus the delay valuewhen the start time type is delayed, or a start moment of the specifiedtime interval is the start time value when the start time type isscheduled.

Optionally, the flow effective time parameter further includes aduration type, where the duration type is keeping effective, absolutelybecoming invalid, or becoming invalid during idle time, and the durationvalue is an invalid value when the duration type is keeping effective,an end moment of the specified time interval is the start moment of thespecified time interval plus the duration value when the duration typeis absolutely becoming invalid, or an end moment of the specified timeinterval is a moment when time at which the first network device doesnot process the service traffic corresponding to the route related tothe flow effective time parameter reaches the duration value and whenthe duration type is becoming invalid during idle time.

Optionally, the flow effective time parameter further includes aduration type and a period value, where the duration type is absolutelybecoming invalid, the period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period, and the periodvalue is greater than or equal to the duration value, where a startmoment of periodically becoming effective is the start time value or themoment at which the first network device starts processing the routecontrol message, each period interval of periodically becoming effectiveincludes the specified time interval, the start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective, and duration of the specified time interval is theduration value.

Based on the foregoing, a more comprehensive limited-time effectivepolicy can be implemented by defining the start time type, the durationtype, the delay value, and the period value for the flow effective timeparameter. For example, limited-time effective policies such as delayedcontrol, periodic control, or becoming invalid during idle time can beimplemented to perform more complex joint control on multiple networkdevices.

Optionally, the route control message further includes at least one ofthe parameters such as a flow identifier (ID), flow description, flowcreation time, or a flag of canceling an invalid route.

Optionally, the route control message is an extended BGP update message,where the extended BGP update message includes network layerreachability information (NLRI), the NLRI carries the route related tothe flow effective time parameter, and the flow effective time parameteris used to indicate that the route related to the flow effective timeparameter is effective in the specified time interval.

Optionally, the extended BGP update message includes a flow extensionattribute, the flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter. The flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field, where the flow effective time typefield is used to indicate a type of the flow effective time field, thefirst length field is used to indicate a length of the flow effectivetime field, the start time value field is used to carry the start timevalue, and the duration value field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field, where thestart time type field is used to indicate immediate, delayed, orscheduled, the duration type field is used to indicate keepingeffective, absolutely becoming invalid, or becoming invalid during idletime, and the delay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field, where the period value field is used to carry the periodvalue.

Optionally, the flow extension attribute further includes a flow IDfield, and the flow ID field includes a flow ID type field, a secondlength field, an AS ID field, a router ID field, and a flow ID valuefield, where the flow ID type field is used to indicate a type of theflow ID field, the second length field is used to indicate a length ofthe flow ID field, the AS ID field is used to indicate an AS in whichthe first network device is located, the router ID field is used toidentify the first network device, and the flow ID value field is usedto carry the flow ID.

Optionally, the flow extension attribute further includes a flowdescription field, and the flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field, where the flow description type field is used to indicate atype of the flow description field, the third length field is used toindicate a length of the flow description field, and the flowdescription value field is used to carry the flow description.

Optionally, the flow extension attribute further includes a flowcreation time field, and the flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field, where the flow creation time type field is used toindicate a type of the flow creation time field, the fourth length fieldis used to indicate a length of the flow creation time field, and theflow creation time value field is used to carry a flow creation timevalue.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

A route control message is generated based on the BGP such that a floweffective time parameter is carried in an extended BGP update messageand is disseminated in multiple network devices. In addition,limited-time effective information can be automatically disseminatedacross AS domains based on the BGP.

According to a second aspect, a route processing method is provided, andthe method includes receiving, by a second network device, a routecontrol message from a first network device, where the route controlmessage carries a flow effective time parameter and a route related tothe flow effective time parameter, the flow effective time parameterincludes a start time value and a duration value, and the flow effectivetime parameter is used to indicate that the route related to the floweffective time parameter is effective in a time interval specified bythe flow effective time parameter, processing, by the second networkdevice in the specified time interval, service traffic corresponding tothe route related to the flow effective time parameter, and sending, bythe second network device, the route control message to other networkdevices, where the other network devices do not include the firstnetwork device.

Optionally, the flow effective time parameter further includes a starttime type, where the start time type is immediate, delayed, orscheduled, and a start moment of the specified time interval is a momentat which the second network device starts processing the route controlmessage when the start time type is immediate, the flow effective timeparameter further includes a delay value, and a start moment of thespecified time interval is the start time value plus the delay valuewhen the start time type is delayed, or a start moment of the specifiedtime interval is the start time value when the start time type isscheduled.

Optionally, the flow effective time parameter further includes aduration type, where the duration type is keeping effective, absolutelybecoming invalid, or becoming invalid during idle time, and the durationvalue is an invalid value when the duration type is keeping effective,an end moment of the specified time interval is the start moment of thespecified time interval plus the duration value when the duration typeis absolutely becoming invalid, or an end moment of the specified timeinterval is a moment when time at which the second network device doesnot process the service traffic corresponding to the route related tothe flow effective time parameter reaches the duration value and whenthe duration type is becoming invalid during idle time.

Optionally, the flow effective time parameter further includes aduration type and a period value, where the duration type is absolutelybecoming invalid, the period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period, and the periodvalue is greater than or equal to the duration value, where a startmoment of periodically becoming effective is the start time value or themoment at which the second network device starts processing the routecontrol message, each period interval of periodically becoming effectiveincludes the specified time interval, the start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective, and duration of the specified time interval is theduration value.

Optionally, the second network device modifies the flow effective timeparameter.

Optionally, the route control message further includes at least one ofthe parameters such as a flow ID, flow description, flow creation time,or a flag of canceling an invalid route.

Optionally, the route control message is an extended BGP update message,where the extended BGP update message includes NLRI, the NLRI carriesthe route related to the flow effective time parameter, and the floweffective time parameter is used to indicate that the route related tothe flow effective time parameter is effective in the specified timeinterval.

Optionally, the extended BGP update message includes a flow extensionattribute, the flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter, the flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field, where the flow effective time typefield is used to indicate a type of the flow effective time field, thefirst length field is used to indicate a length of the flow effectivetime field, the start time value field is used to carry the start timevalue, and the duration value field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field, where thestart time type field is used to indicate immediate, delayed, orscheduled, the duration type field is used to indicate keepingeffective, absolutely becoming invalid, or becoming invalid during idletime, and the delay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field, where the period value field is used to carry the periodvalue.

Optionally, the flow extension attribute further includes a flow IDfield, and the flow ID field includes a flow ID type field, a secondlength field, an AS ID field, a router ID field, and a flow ID valuefield, where the flow ID type field is used to indicate a type of theflow ID field, the second length field is used to indicate a length ofthe flow ID field, the AS ID field is used to indicate an AS in whichthe first network device is located, the router ID field is used toidentify the first network device, and the flow ID value field is usedto carry the flow ID.

Optionally, the flow extension attribute further includes a flowdescription field, and the flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field, where the flow description type field is used to indicate atype of the flow description field, the third length field is used toindicate a length of the flow description field, and the flowdescription value field is used to carry the flow description.

Optionally, the flow extension attribute further includes a flowcreation time field, and the flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field, where the flow creation time type field is used toindicate a type of the flow creation time field, the fourth length fieldis used to indicate a length of the flow creation time field, and theflow creation time value field is used to carry a flow creation timevalue.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

According to a third aspect, a first network device is provided,including an obtaining unit configured to obtain a flow effective timeparameter and a route related to the flow effective time parameter,where the flow effective time parameter includes a start time value anda duration value, and the flow effective time parameter is used toindicate that the route related to the flow effective time parameter iseffective in a time interval specified by the flow effective timeparameter, a processing unit configured to process, in the specifiedtime interval, service traffic corresponding to the route related to theflow effective time parameter, and generate a route control message,where the route control message carries the flow effective timeparameter and the route related to the flow effective time parameter,and a sending unit configured to send the route control message to asecond network device.

Optionally, the obtaining unit is further configured to receive the floweffective time parameter and the route related to the flow effectivetime parameter from a management device.

Optionally, the flow effective time parameter further includes a starttime type, where the start time type is immediate, delayed, orscheduled, and a start moment of the specified time interval is a momentat which the processing unit starts processing the route control messagewhen the start time type is immediate, the flow effective time parameterfurther includes a delay value, and a start moment of the specified timeinterval is the start time value plus the delay value when the starttime type is delayed, or a start moment of the specified time intervalis the start time value when the start time type is scheduled.

Optionally, the flow effective time parameter further includes aduration type, where the duration type is keeping effective, absolutelybecoming invalid, or becoming invalid during idle time, and the durationvalue is an invalid value when the duration type is keeping effective,an end moment of the specified time interval is the start moment of thespecified time interval plus the duration value when the duration typeis absolutely becoming invalid, or an end moment of the specified timeinterval is a moment when time at which the processing unit does notprocess the service traffic corresponding to the route related to theflow effective time parameter reaches the duration value and when theduration type is becoming invalid during idle time.

Optionally, the flow effective time parameter further includes aduration type and a period value, where the duration type is absolutelybecoming invalid, the period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period, and the periodvalue is greater than or equal to the duration value, where a startmoment of periodically becoming effective is the start time value or themoment at which the processing unit starts processing the route controlmessage, each period interval of periodically becoming effectiveincludes the specified time interval, the start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective, and duration of the specified time interval is theduration value.

Optionally, the route control message further includes at least one ofthe parameters such as a flow ID, flow description, flow creation time,or a flag of canceling an invalid route.

Optionally, the route control message is an extended BGP update message,where the extended BGP update message includes NLRI, the NLRI carriesthe route related to the flow effective time parameter, and the floweffective time parameter is used to indicate that the route related tothe flow effective time parameter is effective in the specified timeinterval.

Optionally, the extended BGP update message includes a flow extensionattribute, the flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter, the flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field, where the flow effective time typefield is used to indicate a type of the flow effective time field, thefirst length field is used to indicate a length of the flow effectivetime field, the start time value field is used to carry the start timevalue, and the duration value field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field, where thestart time type field is used to indicate immediate, delayed, orscheduled, the duration type field is used to indicate keepingeffective, absolutely becoming invalid, or becoming invalid during idletime, and the delay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field, where the period value field is used to carry the periodvalue.

Optionally, the flow extension attribute further includes a flow IDfield, and the flow ID field includes a flow ID type field, a secondlength field, an AS ID field, a router ID field, and a flow ID valuefield, where the flow ID type field is used to indicate a type of theflow ID field, the second length field is used to indicate a length ofthe flow ID field, the AS ID field is used to indicate an AS in whichthe first network device is located, the router ID field is used toidentify the first network device, and the flow ID value field is usedto carry the flow ID.

Optionally, the flow extension attribute further includes a flowdescription field, and the flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field, where the flow description type field is used to indicate atype of the flow description field, the third length field is used toindicate a length of the flow description field, and the flowdescription value field is used to carry the flow description.

Optionally, the flow extension attribute further includes a flowcreation time field, and the flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field, where the flow creation time type field is used toindicate a type of the flow creation time field, the fourth length fieldis used to indicate a length of the flow creation time field, and theflow creation time value field is used to carry a flow creation timevalue.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

According to a fourth aspect, a second network device is provided,including a receiving unit configured to receive a route control messagefrom a first network device, where the route control message carries aflow effective time parameter and a route related to the flow effectivetime parameter, the flow effective time parameter includes a start timevalue and a duration value, and the flow effective time parameter isused to indicate that the route related to the flow effective timeparameter is effective in a time interval specified by the floweffective time parameter, a processing unit configured to process, inthe specified time interval, service traffic corresponding to the routerelated to the flow effective time parameter, and a sending unitconfigured to send the route control message to other network devices,where the other network devices do not include the first network device.

Optionally, the flow effective time parameter further includes a starttime type, where the start time type is immediate, delayed, orscheduled, and a start moment of the specified time interval is a momentat which the processing unit starts processing the route control messagewhen the start time type is immediate, the flow effective time parameterfurther includes a delay value, and a start moment of the specified timeinterval is the start time value plus the delay value when the starttime type is delayed, or a start moment of the specified time intervalis the start time value when the start time type is scheduled.

Optionally, the flow effective time parameter further includes aduration type, where the duration type is keeping effective, absolutelybecoming invalid, or becoming invalid during idle time, and the durationvalue is an invalid value when the duration type is keeping effective,an end moment of the specified time interval is the start moment of thespecified time interval plus the duration value when the duration typeis absolutely becoming invalid, or an end moment of the specified timeinterval is a moment when time at which the processing unit does notprocess the service traffic corresponding to the route related to theflow effective time parameter reaches the duration value and when theduration type is becoming invalid during idle time.

Optionally, the flow effective time parameter further includes aduration type and a period value, where the duration type is absolutelybecoming invalid, the period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period, and the periodvalue is greater than or equal to the duration value, where a startmoment of periodically becoming effective is the start time value or themoment at which the processing unit starts processing the route controlmessage, each period interval of periodically becoming effectiveincludes the specified time interval, the start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective, and duration of the specified time interval is theduration value.

Optionally, the second network device further includes a modificationunit configured to modify the flow effective time parameter.

Optionally, the route control message further includes at least one ofthe parameters such as a flow ID, flow description, flow creation time,or a flag of canceling an invalid route.

Optionally, the route control message is an extended BGP update message,where the extended BGP update message includes NLRI, the NLRI carriesthe route related to the flow effective time parameter, and the floweffective time parameter is used to indicate that the route related tothe flow effective time parameter is effective in the specified timeinterval.

Optionally, the extended BGP update message includes a flow extensionattribute, the flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter, the flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field, where the flow effective time typefield is used to indicate a type of the flow effective time field, thefirst length field is used to indicate a length of the flow effectivetime field, the start time value field is used to carry the start timevalue, and the duration value field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field, where thestart time type field is used to indicate immediate, delayed, orscheduled, the duration type field is used to indicate keepingeffective, absolutely becoming invalid, or becoming invalid during idletime, and the delay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field, where the period value field is used to carry the periodvalue.

Optionally, the flow extension attribute further includes a flow IDfield, and the flow ID field includes a flow ID type field, a secondlength field, an AS ID field, a router ID field, and a flow ID valuefield, where the flow ID type field is used to indicate a type of theflow ID field, the second length field is used to indicate a length ofthe flow ID field, the AS ID field is used to indicate an AS in whichthe first network device is located, the router ID field is used toidentify the first network device, and the flow ID value field is usedto carry the flow ID.

Optionally, the flow extension attribute further includes a flowdescription field, and the flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field, where the flow description type field is used to indicate atype of the flow description field, the third length field is used toindicate a length of the flow description field, and the flowdescription value field is used to carry the flow description.

Optionally, the flow extension attribute further includes a flowcreation time field, and the flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field, where the flow creation time type field is used toindicate a type of the flow creation time field, the fourth length fieldis used to indicate a length of the flow creation time field, and theflow creation time value field is used to carry a flow creation timevalue.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

According to a fifth aspect, a network system is provided, where thenetwork system includes a first network device and a second networkdevice, where the first network device is the first network deviceaccording to the third aspect, and the second network device is secondnetwork device according to the fourth aspect.

By means of implementations in this application, a first network deviceobtains a flow effective time parameter and a route related to the floweffective time parameter. The flow effective time parameter includes astart time value and a duration value. The flow effective time parameteris used to indicate that the route is effective in a time intervalspecified by the flow effective time parameter. The first network devicesends the flow effective time parameter and the route to other networkdevices using a route control message. Therefore, limited-time effectiveinformation is automatically disseminated, a limited-time effectiverequirement for a traffic control policy is met, configuration workloadis reduced, and maintenance difficulty is lowered.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flowchart of a route processing method executed by a firstnetwork device according to an embodiment of this application;

FIG. 2 is a schematic diagram of a format of a flow effective time fieldaccording to an embodiment of this application;

FIG. 3 is a schematic diagram of a format of a flow ID field accordingto an embodiment of this application;

FIG. 4 is a schematic diagram of a format of a flow description fieldaccording to an embodiment of this application;

FIG. 5 is a schematic diagram of a format of a flow creation time fieldaccording to an embodiment of this application;

FIG. 6 is a flowchart of a route processing method executed by a secondnetwork device according to an embodiment of this application;

FIG. 7 is a flowchart of a route processing method executed by amanagement device according to an embodiment of this application;

FIG. 8 is a schematic diagram of a structure of an application scenarioaccording to an embodiment of this application;

FIG. 9 is a schematic diagram of a structure of a first network deviceaccording to an embodiment of this application;

FIG. 10 is a schematic diagram of a hardware structure of a firstnetwork device according to an embodiment of this application;

FIG. 11 is a schematic diagram of a structure of a second network deviceaccording to an embodiment of this application;

FIG. 12 is a schematic diagram of a hardware structure of a secondnetwork device according to an embodiment of this application; and

FIG. 13 is a schematic diagram of a structure of a network systemaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The embodiments of this application provide a route processing method, adevice, and a system in order to resolve problems that limited-timeeffective information of multiple network devices cannot bedisseminated, and a limited-time effective requirement for a trafficcontrol policy cannot be met in a service traffic control scenario withthe multiple network devices.

The following provides detailed descriptions separately using specificembodiments.

To make the application objectives, features, and advantages of thisapplication clearer and more comprehensible, the following clearlydescribes the technical solutions in the embodiments of this applicationwith reference to the accompanying drawings in the embodiments of thisapplication. The embodiments described in the following are merely apart rather than all of the embodiments of this application. All otherembodiments obtained by a person of ordinary skill in the art based onthe embodiments of this application without creative efforts shall fallwithin the protection scope of this application.

In the specification, claims, and accompanying drawings of thisapplication, the terms “first,” “second,” “third,” “fourth” and so onare intended to distinguish between different objects but do notindicate a particular order. In addition, the terms “include” and “have”are not exclusive. For example, a process, a method, a system, aproduct, or a device including a series of steps or units is not limitedto the listed steps or units, and may further include steps or unitsthat are not listed.

It should be understood that technical solutions in the embodiments ofthis application may be applied to various routing protocol scenarios,for example, scenarios of BGP-based dissemination of information aboutIP routes, VPN routes, and the BGP FlowSpec, routing scenarios based onthe Intermediate System-to-Intermediate System (IS-IS), routingscenarios based on Open Shortest Path First (OSPF).

FIG. 1 is a flowchart of a route processing method executed by a firstnetwork device. As shown in FIG. 1, the first network device may belocated in a first AS. Further, the first network device may be a borderrouter (BR) and a network forwarding device such as a router or a switchhaving layer-3 functions may function as the BR. For example, in anetwork architecture scenario based on separated control and forwarding,a management device manages the first AS, and the management device usesa control channel protocol to control the first network device. Themanagement device may be a network management device, an applicationprogram device, or the like. The route processing method executed by thefirst network device includes the following steps.

Step S102: The first network device obtains a flow effective timeparameter and a route related to the flow effective time parameter,where the flow effective time parameter includes a start time value anda duration value, and the flow effective time parameter is used toindicate that the route related to the flow effective time parameter iseffective in a time interval specified by the flow effective timeparameter.

Step S104: The first network device processes, in the specified timeinterval, service traffic corresponding to the route related to the floweffective time parameter, and generates a route control message, wherethe route control message carries the flow effective time parameter andthe route related to the flow effective time parameter.

Step S106: The first network device sends the route control message to asecond network device.

In this embodiment, the flow effective time (also referred to as Flowvalid time) parameter refers to a valid time interval of the routerelated to the flow effective time parameter. The route corresponds tothe service traffic when the route is applied to a forwarding plane.Therefore, the flow effective time parameter may also be considered as avalid time interval of the flow related to the flow effective timeparameter. The flow effective time parameter and the route related tothe flow effective time parameter may be configured on the first networkdevice or on the management device. Optionally, a specificimplementation of configuring the flow effective time parameter and theroute related to the flow effective time parameter on the first networkdevice may include manually configuring the flow effective timeparameter and a route that needs to become effective in limited time onthe first network device, or manually configuring the flow effectivetime parameter and a rule filter on the first network device andfiltering and finding a route that meets a filter rule according to therule filter on the first network device. The route may be a routingentry. The filter rule may be an AS path, a community, a prefix, or thelike. The route that needs to become effective in limited time isdetermined according to the filter rule. In addition, in the networkarchitecture scenario based on separated control and forwarding, theforegoing configuration process may be completed on the managementdevice. Then, the management device sends the flow effective timeparameter and the route related to the flow effective time parameter tothe first network device based on the control channel protocol using aninterface. The control channel protocol may be the network configurationprotocol (Netconf), the Simple Network Management Protocol (SNMP), theSimple Object Access Protocol (SOAP), or the Representational StateTransfer (RESTful) Application Programming Interface (API) overHypertext Transfer Protocol (HTTP). The flow effective time parameterincludes a start time value and a duration value. The start time valueis used to indicate a start moment at which the route related to theflow effective time parameter becomes effective. The start time value isusually represented as a difference between the start moment and 0:0 onJan. 1, 1970, and may be accurate to microseconds (p) or milliseconds(ms). 0 indicates an invalid value. The duration value is used toindicate duration in which the route related to the flow effective timeparameter is effective. The duration may be accurate to μs or ms. 0indicates an invalid value. Therefore, the flow effective time parameteris used to indicate that the route related to the flow effective timeparameter is effective in the time interval specified by the floweffective time parameter. A start moment of the specified time intervalis the start time value, and an end moment of the specified timeinterval is the start time value plus the duration value. For example, astart time value is 18:00 on Jan. 1, 2015, a duration value is 120minutes, and a route invalid time is 20:00 on Jan. 1, 2015.

In this embodiment, the first network device generates the route controlmessage. The route control message carries the flow effective timeparameter and the route related to the flow effective time parameter.Optionally, the route control message may be represented in multiplespecific forms. For example, the route control message is generatedbased on the BGP and may be an extended BGP update message. The extendedBGP update message may be based on an IP route, a VPN route, or the BGPFlowSpec. For another example, the route control message is generatedbased on the IS-IS and may be an extended IS-IS link state packet (LSP).For another example, the route control message is generated based on theOSPF and may be an extended OSPF link state (LS) update packet.

In this embodiment, the first network device processes, according to theflow effective time parameter, the service traffic corresponding to theroute related to the flow effective time parameter. When processing theroute, the first network device checks the flow effective time parametercorresponding to the route. If the flow effective time parameter exists,the first network device controls, according to the flow effective timeparameter, a time at which the route becomes effective, and processesthe service traffic corresponding to the route. If the flow effectivetime parameter does not exist, the first network device processes theroute as a common route. For example, the first network device runs theBGP and preferentially selects a route according to a route selectionrule. If the selected route has a corresponding flow effective timeparameter, the first network device controls, according to the floweffective time parameter, a time at which the route becomes effective,and processes service traffic corresponding to the route. The routeselection rule includes, for example, ignoring a route if a next hop ofthe route is unreachable, selecting a route whose local preference ishigher, selecting a route that is originated/aggregated by a localrouter, selecting a route whose AS path is shorter, sequentiallyselecting a route whose start point type is an Interior Gateway Protocol(IGP) type, or an Exterior Gateway Protocol (EGP) type, selecting aroute whose multi-exit descriminator (MED) is smaller, preferentiallyselecting a route that is learned from the External BGP (EBGP),preferentially selecting a route whose IGP metric is lowest in an AS,selecting a route whose router ID is smaller, or the like. The foregoingrules may be used individually or in combination.

In this embodiment, the first network device sends the route controlmessage to the second network device. The first network device may usethe route control message to disseminate the effective time parameterand the route related to the flow effective time parameter to the secondnetwork device. After receiving the route control message, the secondnetwork device may process, according to the flow effective timeparameter, the service traffic corresponding to the route related to theflow effective time parameter.

Optionally, the sequence for processing, in the specified time interval,the service traffic corresponding to the route related to the floweffective time parameter in step S104, generating the route controlmessage in step S104, and sending the route control message to thesecond network device in step S106 is not limited. For example,processing, in the specified time interval, the service trafficcorresponding to the route related to the flow effective time parametermay be performed before, after, or at the same time of generating theroute control message and sending the route control message to thesecond network device.

Existing routing protocols do not support a limited-time effectivefeature and cannot meet a limited-time effective requirement for atraffic control policy. An ACL can only be locally deployed on a singlerouter, and cannot be applied to a multi-router joint action scenario.

In the route processing method provided in this embodiment, a firstnetwork device generates a route control message, where the routecontrol message carries a flow effective time parameter and a routerelated to the flow effective time parameter, and sends the routecontrol message to a second network device. Therefore, the floweffective time parameter is automatically disseminated among multiplenetwork devices, a limited-time effective requirement for a trafficcontrol policy is met, configuration workload is reduced, andmaintenance difficulty is lowered.

Optionally, obtaining, by a first network device, a flow effective timeparameter and a route related to the flow effective time parameterincludes receiving, by the first network device, the flow effective timeparameter and the route related to the flow effective time parameterfrom the management device.

According to the foregoing description in this embodiment, the floweffective time parameter may be locally configured on the first networkdevice. For the network architecture scenario based on separated controland forwarding, the flow effective time parameter may be configured onthe management device and sent by the management device to the firstnetwork device. A process of configuring the flow effective timeparameter may be statically configured by a network administrator orautomatically configured according to a preset rule.

Optionally, the flow effective time parameter further includes a starttime type. The start time type is immediate (also referred to asImmediate validation), delayed (also referred to as Delayed validation),or scheduled (also referred to as Timing validation). When the starttime type is immediate, a start moment of the specified time interval isa moment at which the first network device starts processing the routecontrol message. When the start time type is delayed, the flow effectivetime parameter further includes a delay value, and a start moment of thespecified time interval is the start time value plus a delay value. Whenthe start time type is scheduled, a start moment of the specified timeinterval is the start time value.

For example, when the start time type is immediate, the first networkdevice by default considers the start time value as invalid regardlessof whether the start time value is any numerical value. The firstnetwork device uses the moment at which the first network device startsprocessing the route control message as the start moment. The moment atwhich the first network device starts processing the route controlmessage is a moment at which the network device parses andpreferentially selects, after receiving the route control message, theroute that is related to the flow effective time parameter and carriedin the route control message, and installs the route in a forwardinginformation base (FIB) of the forwarding plane. Immediately becomingeffective is equivalent to that a network device without time parametercontrol obtains a route and the route directly becomes effective inother approaches. A conventional BGP update message is used as anexample. The BGP update message is deployed and transferred. A networkdevice that receives the BGP update message directly processes the BGPupdate message. Therefore, setting the start time type to immediate mayachieve a same effect as that in the other approaches. Optionally, theend moment of the specified time interval is the moment at which thefirst network device starts processing the route control message plusthe duration value.

When the start time type is delayed, a start moment of the specifiedtime interval is the start time value plus the delay value.Correspondingly, the end moment of the specified time interval is addingthe delay value to a sum of the start time value and the duration value.For example, a start time value is 18:00 on Jan. 1, 2015, a durationvalue is 120 minutes, and an end moment (a time at which a route isinvalid) is 20:00 on Jan. 1, 2015. If a start time type is delayed and adelay value is 30 minutes, an actual start time value is 18:30 on Jan.1, 2015, and an actual end moment (a time at which a route is invalid)is 20:30 on Jan. 1, 2015.

When the start time type is scheduled, optionally, an end moment of thespecified time interval is the start time value plus the duration value.

The start time type is not limited herein. Another start time type maybe defined according to an actual management requirement.

Optionally, the flow effective time parameter further includes aduration type. The duration type is keeping effective (also referred toas permanent validation), absolutely becoming invalid (also referred toas hard invalidation), or becoming invalid during idle time (alsoreferred to as idle invalidation). When the duration type is keepingeffective, the duration value is an invalid value. When the durationtype is absolutely becoming invalid, an end moment of the specified timeinterval is the start moment of the specified time interval plus theduration value. When the duration type is becoming invalid during idletime, an end moment of the specified time interval is a moment when timeat which the first network device does not process the service trafficcorresponding to the route related to the flow effective time parameterreaches the duration value.

For example, when the duration type is keeping effective, the firstnetwork device by default considers the duration value as invalidregardless of whether the duration value is any numerical value. Acorresponding route keeps effective until a route control messageindicating route cancellation is received. Therefore, keeping effectivemay be equivalent to that a network device without time parametercontrol obtains a route and the route directly becomes effective andkeeps effective in the other approaches. A conventional BGP updatemessage is used as an example. The BGP update message is deployed andtransferred. A network device that receives the BGP update messagedirectly processes the BGP update message. Further, the network devicealways keeps a route carried in the BGP update message effective withoutreceiving a further instruction. Therefore, setting the duration type tokeeping effective may be compatible with an implementation in which theroute control message is directly deployed to keep the route effective.Correspondingly, a start time of the specified time interval is thestart time value.

When the duration type is absolutely becoming invalid, the end moment ofthe specified time interval is the start moment of the specified timeinterval plus the duration value. Optionally, when the start time typeis not limited or is scheduled, the start moment of the specified timeinterval is the start time value, and the end moment of the specifiedtime interval is the start time value plus the duration value. When thestart time type is delayed, the start moment of the specified timeinterval is the start time value plus the delay value, and the endmoment of the specified time interval is adding the delay value to thesum of the start time value and the duration value. When the start timetype is immediate, the start moment of the specified time interval isthe moment at which the first network device starts processing the routecontrol message, and the end moment of the specified time interval isthe moment at which the first network device starts processing the routecontrol message plus the duration value. For example, a start time valueis 18:00 on Jan. 1, 2015, a duration value is 120 minutes, a durationtype is absolutely becoming invalid, and a time at which a route isinvalid is 20:00 on Jan. 1, 2015.

When the duration type is becoming invalid during idle time, optionally,when the start time type is not limited or is scheduled, the startmoment of the specified time interval is the start time value, and whenthe start time type is immediate, the start moment of the specified timeinterval is the moment at which the first network device startsprocessing the route control message. When the duration type is becominginvalid during idle time, and the first network device does not processthe service traffic corresponding to the route related to the floweffective time parameter in duration indicated by the duration value (itmay be understood as duration in which the service traffic needing to beprocessed and corresponding to the route is not generated after theroute becomes effective), the route related to the flow effective timeparameter becomes invalid. Therefore, becoming invalid during idle timerefers to that when the route keeps effective and time in which theroute is idle reaches the duration value, the route is triggered to beinvalid. For example, a start time value is 18:00 on Jan. 1, 2015, aduration value is 30 minutes, and a duration type is becoming invalidduring idle time. After a route becomes effective, if time in which theroute is idle (that is, duration in which service traffic needing to beprocessed and corresponding to the route is not generated) does notreach 30 minutes, counting is restarted. If time in which the route isidle (that is, duration in which service traffic needing to be processedand corresponding to the route is not generated) reaches 30 minutes, theroute is triggered to be invalid. If duration in which the route is notapplied to the corresponding service traffic still does not reach 30minutes, the route keeps effective, and becomes invalid until theduration in which the route is not applied to the corresponding servicetraffic reaches 30 minutes.

Optionally, the flow effective time parameter further includes aduration type and a period value. The duration type is absolutelybecoming invalid. The period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period. The period valueis greater than or equal to the duration value. A start moment ofperiodically becoming effective is the start time value or the moment atwhich the first network device starts processing the route controlmessage. Each period interval of periodically becoming effectiveincludes the specified time interval. The start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective. Duration of the specified time interval is theduration value.

For example, when the period value is valid, the route related to theflow effective time parameter repeatedly becomes effective in a periodinterval being the period value. As described above, a start moment of afirst period interval is the start time value or the moment at which thefirst network device starts processing the route control message, andduration of the first period interval is the period value. Starting fromthe second period interval, a start moment of each period interval is anend moment of a previous period interval and duration is the periodvalue. Each period interval includes one specified time interval. Theroute related to the flow effective time parameter repeatedly becomeseffective in a period interval being the period value, until a routecontrol message indicating route cancellation is received. In addition,when the period value is less than the duration value, the period valueis invalid.

For example, when the duration type is absolutely becoming invalid, theperiod value is valid. For example, a start time value is 18:00 on Jan.1, 2015, a duration value is 30 minutes, and a period value is 120minutes. A route becomes effective at 18:00 on Jan. 1, 2015, and becomesinvalid at 18:30 on Jan. 1, 2015. Because the period value is valid (astart moment of the period value is 18:00 on Jan. 1, 2015), the routebecomes effective again at 20:00 on Jan. 1, 2015. The duration value is30 minutes. That is, the route becomes effective at 20:00 on Jan. 1,2015, and becomes invalid at 20:30 on Jan. 1, 2015. Then, the routebecomes effective again at 22:00 on Jan. 1, 2015. The foregoing processrepeats.

Optionally, if the period value is less than the duration value, thefirst network device may use a notification message, for example, a BGPnotification, to notify a parameter sender that the defined period valueis incorrect.

Based on the foregoing, a more comprehensive limited-time effectivepolicy can be implemented by defining the start time type, the durationtype, the delay value, and the period value for the flow effective timeparameter. For example, limited-time effective policies such as delayedcontrol, periodic control, or becoming invalid during idle time can beimplemented to perform more complex joint control on multiple networkdevices.

Optionally, the first network device modifies the flow effective timeparameter.

Further, the first network device may modify any parameter in the floweffective time parameter, for example, modify the start time value, orchange the start time type.

Optionally, the route control message further includes at least one ofthe parameters such as a flow ID, flow description, flow creation time,or a flag of canceling an invalid route.

For example, a flow ID is used to uniquely identify a flow, and may beapplied to a partial control scenario (such as fault diagnosis and log)to simplify the process of identifying a flow. Specific content and aconfiguration rule of a flow do not need to be indicated, and the flowID is used to simplify an identifying process. The flow ID may furtherinclude an AS ID, a router ID, and a flow ID value. The AS ID is an IDof an AS in which an originating network device is located. In thisembodiment, the AS ID is an ID of an AS in which the first networkdevice is located. The router ID is an ID of the originating networkdevice. In this embodiment, the router ID is an ID of the first networkdevice. AS ID+router ID+flow ID value may uniquely identify a flow.

Flow description is used to describe a route control message, forexample, describe a limited-time function or usage of the route controlmessage.

Flow creation time is a creation time of the route control message inthe originating network device. In this embodiment, the originatingnetwork device is the first network device. The flow creation time maybe used for diagnosis or log tracking.

The network device usually does not proactively cancel a currentlyinvalid route, but only identifies the route as invalid. In any case,the network device may receive a route control message indicating routecancellation and passively cancel the invalid route. The flag ofcanceling an invalid route is used to indicate whether to proactivelycancel an already invalid route. When the flag of canceling an invalidroute is set, the network device proactively cancels the currentlyinvalid route.

As described above, the route control message may be generated based onthe BGP, IS-IS, or OSPF. The following separately describes the threeapplication scenarios.

Application scenario 1: The route control message may be generated basedon the BGP.

Optionally, the route control message is an extended BGP update message.The extended BGP update message includes NLRI. The NLRI carries theroute related to the flow effective time parameter. The flow effectivetime parameter is used to indicate that the route related to the floweffective time parameter is effective in the specified time interval.

As described above, the route control message may be generated based theBGP and may be an extended BGP update message. The extended BGP updatemessage may be based on an IP route, a VPN route, or the BGP FlowSpec.The extended BGP update message carries the flow effective timeparameter and the route related to the flow effective time parameter.Further, the route related to the flow effective time parameter isencapsulated into NLRI of the extended BGP update message. The floweffective time parameter is used to indicate that the route related tothe flow effective time parameter is effective in the specified timeinterval.

Optionally, the extended BGP update message includes a flow extensionattribute, the flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter. The flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field. The flow effective time type field isused to indicate a type of the flow effective time field, the firstlength field is used to indicate a length of the flow effective timefield, the start time value field is used to carry the start time value,and the duration value field is used to carry the duration value.

For example, currently the BGP defines 16 attribute types, including ASpath, community, and extended community. The BGP is extended in thisapplication and a new attribute type is defined, that is, the flowextension attribute. The flow extension attribute exists together withthe existing 16 attribute types. The extended BGP update messageincludes the flow extension attribute. The flow extension attributeincludes the flow effective time field, as shown in FIG. 2. FIG. 2 is aschematic diagram of a format of the flow effective time field. The floweffective time field may be defined using a type-length-value (TLV)format. The flow effective time field is used to carry the floweffective time parameter. The flow effective time field includes theflow effective time type field, a length field, the start time valuefield, and the duration value field. The flow effective time type fieldis used to indicate a type of the flow effective time field, the lengthfield is used to indicate a length of the flow effective time field, thestart time value field is used to carry the start time value, and theduration value field is used to carry the duration value. Both the starttime value field and the duration value field include two fields: second(s) and μs. A final numerical value of the start time value field or theduration value field is a sum of numerical values in the two fields, sand μs. For example, a numerical value of the start time value field isa start time value (s)+a start time value (μs). The flow effective timetype field and the length field each occupy two bytes, and the starttime value field and the duration value field each occupy eight bytes(i.e., 4 bytes from s and 4 bytes from μs fields). This is not limitedherein.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field. The starttime type field is used to indicate immediate, delayed, or scheduled.The duration type field is used to indicate keeping effective,absolutely becoming invalid, or becoming invalid during idle time. Thedelay value field is used to carry the delay value.

For example, as shown in FIG. 2, the flow effective time field furtherincludes the start time type field, the duration type field, and thedelay value field. The start time type field and the duration type fieldeach occupy two bytes, and the delay value field occupies eight bytes.This is not limited herein. The delay value field includes two fields sand μs. A final numerical value of the delay value field is a sum ofnumerical values in the two fields, s and μs.

The start time type field is used to indicate immediate, delayed, orscheduled. As shown in Table 1, the first column of the Table 1indicates a type, and the second column describes functions. 0, 1, and 2in the first column of the Table 1 are merely examples, and may bedefined by a standard organization. Table 1 defines three common types.Other types may be defined. This is not limited herein.

TABLE 1 Definitions of the start time type Type Function Description 0Immediate (immediate validation) 1 Delayed (delayed validation) 2Scheduled (timing validation) . . . . . .

The duration type field is used to indicate keeping effective,absolutely becoming invalid, or becoming invalid during idle time. Asshown in Table 2, the first column of the Table 2 indicates a type, andthe second column describes functions. 0, 1, and 2 in the first columnof the Table 2 are merely examples, and may be defined by a standardorganization. Table 2 defines three common types. Other types may bedefined. This is not limited herein.

TABLE 2 Definitions of the duration type Type Function Description 0Keeping effective (permanent validation) 1 Absolutely becoming invalid(hard invalidation) 2 Becoming invalid during idle time (idleinvalidation) . . . . . .

Optionally, the flow effective time field further includes a periodvalue field. The period value field is used to carry the period value.

For example, as shown in FIG. 2, the flow effective time field furtherincludes a period value field. The period value field occupies eightbytes, and this is not limited herein. The period value field includestwo fields: s and μs. A final numerical value of the period value fieldis a sum of numerical values in the two fields, s and μs.

The flow effective time field and functions and usage of the fieldsincluded by the flow effective time field are described in the foregoingpart of this embodiment. Details are not provided again herein.

Optionally, the flow extension attribute further includes a flow IDfield. The flow ID field includes a flow ID type field, a second lengthfield, an AS ID field, a router ID field, and a flow ID value field. Theflow ID type field is used to indicate a type of the flow ID field. Thesecond length field is used to indicate a length of the flow ID field.The AS ID field is used to indicate an AS in which the first networkdevice is located. The router ID field is used to identify the firstnetwork device. The flow ID value field is used to carry the flow ID.

For example, as shown in FIG. 3, the flow ID field may be defined usinga TLV format. The flow ID field includes the flow ID type field, thelength field, the AS ID field, the router ID field, and the flow IDvalue field. The flow ID type field and the length field each occupy twobytes. The AS ID field, the router ID field, and the flow ID value fieldeach occupy four bytes. This is not limited herein. In an implementationof the BGP, the flow ID field is used to uniquely identify a FlowSpecrule or an IP prefix.

Optionally, the flow extension attribute further includes a flowdescription field. The flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field. The flow description type field is used to indicate a typeof the flow description field. The third length field is used toindicate a length of the flow description field. The flow descriptionvalue field is used to carry the flow description.

For example, as shown in FIG. 4, the flow extension attribute includesthe flow description field. The flow description field may be definedusing a TLV format. The flow description field includes the flowdescription type field, the length field, and the flow description valuefield. The flow description type field and the length field each occupytwo bytes. The flow description value field is of a variable length anddoes not exceed 256 bytes. This is not limited herein.

Optionally, the flow extension attribute further includes a flowcreation time field. The flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field. The flow creation time type field is used to indicatea type of the flow creation time field. The fourth length field is usedto indicate a length of the flow creation time field. The flow creationtime value field is used to carry a flow creation time value.

For example, as shown in FIG. 5, the flow extension attribute furtherincludes the flow creation time field. The flow creation time field maybe defined using a TLV format. The flow creation time field includes theflow creation time type field, the length field, and the flow creationtime value field. The flow creation time type field and the length fieldeach occupy two bytes, and the flow creation time value field occupieseight bytes. This is not limited herein. The flow creation time valuefield includes two fields: s and μs. A final numerical value of the flowcreation time value field is a sum of numerical values in the twofields, s and μs.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

For example, the flag field of canceling an invalid route may be definedas a standalone field, or may be carried in an existing field, forexample, carried in the flow effective time field.

Functions and usage of the flow ID field, the flow description field,the flow creation time field, and the flag field of canceling an invalidroute are described in the foregoing part of this embodiment. Detailsare not provided again herein.

A route control message is generated based on the BGP such that a floweffective time parameter is carried in an extended BGP update messageand is disseminated in multiple network devices. In addition,limited-time effective information can be automatically disseminatedacross AS domains based on the BGP.

Application scenario 2: The route control message may be generated basedon the IS-IS.

Optionally, the route control message is an extended IS-IS LSP. Theextended IS-IS LSP includes a FlowSpec reachability field, and theFlowSpec reachability field includes the flow effective time field. Theflow effective time field is used to carry the flow effective timeparameter. The flow effective time field includes the flow effectivetime type field, the length field, the start time value field, and theduration value field. The flow effective time type field is used toindicate a type of the flow effective time field, the length field isused to indicate a length of the flow effective time field, the starttime value field is used to carry the start time value, and the durationvalue field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field. The starttime type field is used to indicate immediate, delayed, or scheduled.The duration type field is used to indicate keeping effective,absolutely becoming invalid, or becoming invalid during idle time. Thedelay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field. The period value field is used to carry the period value.

For example, the extended IS-IS LSP includes the FlowSpec reachabilityfield. The FlowSpec reachability field uses a TLV format. The floweffective time field in a sub-TLV format is carried in the FlowSpecreachability field. The format of the flow effective time field issimilar to the format shown in FIG. 2, and the difference lies only inthat the flow effective time type field and the length field each occupyone byte in the extended IS-IS LSP. Likewise, the FlowSpec reachabilityfield may further carry the flow ID field, the flow description field,the flow creation time field, and the flag field of canceling an invalidroute. Formats of the flow ID field, the flow description field, and theflow creation time field are similar to the formats shown in FIG. 3 andFIG. 5, and the difference lies only in that the type field and thelength field each occupy one byte in the extended IS-IS LSP.

Application scenario 3: The route control message may be generated basedon the OSPF.

Optionally, the route control message is an extended OSPF LS updatepacket. The extended OSPF LS update packet includes a FlowSpec opaquelink state advertisement (LSA) field, and the FlowSpec opaque LSA fieldincludes the flow effective time field. The flow effective time field isused to carry the flow effective time parameter. The flow effective timefield includes the flow effective time type field, the length field, thestart time value field, and the duration value field. The flow effectivetime type field is used to indicate a type of the flow effective timefield, the length field is used to indicate a length of the floweffective time field, the start time value field is used to carry thestart time value, and the duration value field is used to carry theduration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field. The starttime type field is used to indicate immediate, delayed, or scheduled.The duration type field is used to indicate keeping effective,absolutely becoming invalid, or becoming invalid during idle time. Thedelay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field. The period value field is used to carry the period value.

For example, the extended OSPF LS update packet includes the FlowSpecopaque LSA field. The flow effective time field in a TLV format iscarried in the FlowSpec opaque LSA field. The format of the floweffective time field is the same as the format shown in FIG. 2.Likewise, the FlowSpec opaque LSA field may further carry the flow IDfield, the flow description field, the flow creation time field, and theflag field of canceling an invalid route. Formats of the flow ID field,the flow description field, and the flow creation time field are thesame as the formats shown in FIG. 3 and FIG. 5.

In the technical solution provided in this embodiment, a first networkdevice generates a route control message, where the route controlmessage carries a flow effective time parameter and a route related tothe flow effective time parameter, and sends the route control messageto a second network device. Therefore, the flow effective time parameteris automatically disseminated among multiple network devices, alimited-time effective requirement for a traffic control policy is met,configuration workload is reduced, and maintenance difficulty islowered.

FIG. 6 is a flowchart of a route processing method executed by a secondnetwork device according to an embodiment of this application. Theembodiment of this application describes the route processing methodfrom a perspective of the second network device. As shown in FIG. 6, thesecond network device performs the following steps.

Step S602: The second network device receives a route control messagefrom a first network device, where the route control message carries aflow effective time parameter and a route related to the flow effectivetime parameter, the flow effective time parameter includes a start timevalue and a duration value, and the flow effective time parameter isused to indicate that the route related to the flow effective timeparameter is effective in a time interval specified by the floweffective time parameter.

Step S604: The second network device processes, in the specified timeinterval, service traffic corresponding to the route related to the floweffective time parameter.

Step S606: The second network device sends the route control message toother network devices, where the other network devices do not includethe first network device.

Further, the route processing method executed by the second networkdevice shown in FIG. 6 is similar to the route processing methodexecuted by the first network device shown in FIG. 1 in the foregoingembodiment. The difference lies in that the second network device doesnot directly configure the flow effective time parameter and the routerelated to the flow effective time parameter, but receives the routecontrol message from the first network device. The route control messagecarries the flow effective time parameter and the route related to theflow effective time parameter. As an equivalent part of the firstnetwork device, after receiving the route control message, the secondnetwork device processes, according to the flow effective timeparameter, service traffic corresponding to the route related to theflow effective time parameter, and disseminates the route controlmessage to other network devices.

Optionally, the flow effective time parameter further includes a starttime type. The start time type is immediate, delayed, or scheduled. Whenthe start time type is immediate, a start moment of the specified timeinterval is a moment at which the second network device startsprocessing the route control message. The moment at which the secondnetwork device starts processing the route control message is a momentat which the network device parses and preferentially selects, afterreceiving the route control message, the route that is related to theflow effective time parameter and carried in the route control message,and installs the route in an FIB of a forwarding plane. The floweffective time parameter further includes a delay value when the starttime type is delayed. A start moment of the specified time interval isthe start time value plus the delay value. When the start time type isscheduled, a start moment of the specified time interval is the starttime value.

Optionally, the flow effective time parameter further includes aduration type. The duration type is keeping effective, absolutelybecoming invalid, or becoming invalid during idle time. When theduration type is keeping effective, the duration value is an invalidvalue. When the duration type is absolutely becoming invalid, an endmoment of the specified time interval is the start moment of thespecified time interval plus the duration value. When the duration typeis becoming invalid during idle time, an end moment of the specifiedtime interval is a moment when time at which the second network devicedoes not process the service traffic corresponding to the route relatedto the flow effective time parameter reaches the duration value.

Optionally, the flow effective time parameter further includes aduration type and a period value. The duration type is absolutelybecoming invalid. The period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period. The period valueis greater than or equal to the duration value. A start moment ofperiodically becoming effective is the start time value or the moment atwhich the second network device starts processing the route controlmessage. Each period interval of periodically becoming effectiveincludes the specified time interval. The start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective. Duration of the specified time interval is theduration value.

Optionally, the second network device modifies the flow effective timeparameter.

Optionally, the route control message further includes at least one ofthe parameters such as a flow ID, flow description, flow creation time,or a flag of canceling an invalid route.

Optionally, the route control message is an extended BGP update message.The extended BGP update message includes NLRI. The NLRI carries theroute related to the flow effective time parameter. The flow effectivetime parameter is used to indicate that the route related to the floweffective time parameter is effective in the specified time interval.

Optionally, the extended BGP update message includes a flow extensionattribute. The flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter. The flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field. The flow effective time type field isused to indicate a type of the flow effective time field. The firstlength field is used to indicate a length of the flow effective timefield. The start time value field is used to carry the start time value.The duration value field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field. The starttime type field is used to indicate immediate, delayed, or scheduled.The duration type field is used to indicate keeping effective,absolutely becoming invalid, or becoming invalid during idle time. Thedelay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field. The period value field is used to carry the period value.

Optionally, the flow extension attribute further includes a flow IDfield. The flow ID field includes a flow ID type field, a second lengthfield, an AS ID field, a router ID field, and a flow ID value field. Theflow ID type field is used to indicate a type of the flow ID field. Thesecond length field is used to indicate a length of the flow ID field.The AS ID field is used to indicate an AS in which the first networkdevice is located. The router ID field is used to identify the firstnetwork device. The flow ID value field is used to carry the flow ID.

Optionally, the flow extension attribute further includes a flowdescription field. The flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field. The flow description type field is used to indicate a typeof the flow description field. The third length field is used toindicate a length of the flow description field. The flow descriptionvalue field is used to carry the flow description.

Optionally, the flow extension attribute further includes a flowcreation time field. The flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field. The flow creation time type field is used to indicatea type of the flow creation time field. The fourth length field is usedto indicate a length of the flow creation time field. The flow creationtime value field is used to carry a flow creation time value.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

For a specific process of executing the route processing method by thesecond network device, refer to description of the embodimentcorresponding to FIG. 1 and FIG. 5. Details are not provided againherein. Similarly, the route control message may be generated based onthe IS-IS or OSPF in the route processing method executed by the secondnetwork device. For a specific implementation, refer to the descriptionof the foregoing embodiment.

In the technical solution provided in this embodiment, a second networkdevice receives and processes a route control message, and sends theroute control message to other network devices. Therefore, a floweffective time parameter is automatically disseminated among multiplenetwork devices, a limited-time effective requirement for a trafficcontrol policy is met, configuration workload is reduced, andmaintenance difficulty is lowered.

FIG. 7 is a flowchart of a route processing method executed by amanagement device according to an embodiment of this application. Theembodiment of this application describes the route processing methodfrom a perspective of the management device. As shown in FIG. 7, themanagement device performs the following steps.

Step S702: The management device sets a flow effective time parameter,where the flow effective time parameter includes a start time value anda duration value.

Step S704: The management device determines a route related to the floweffective time parameter, where the flow effective time parameter isused to indicate that the route related to the flow effective timeparameter is effective in a time interval specified by the floweffective time parameter.

Step S706. The management device sends the flow effective time parameterand the route related to the flow effective time parameter to a firstnetwork device.

Further, in a network architecture scenario based on separated controland forwarding, a routing information base (RIB) is stored on themanagement device and the flow effective time parameter is directlyconfigured on the management device. Then, the management deviceestablishes a mapping relationship between the flow effective timeparameter and the RIB according to a preset rule. The management devicedetermines the route related to the flow effective time parameter in theRIB according to the flow effective time parameter. The managementdevice sends the flow effective time parameter and the route related tothe flow effective time parameter to the first network device based on acontrol channel protocol using an interface. The control channelprotocol may be Netconf, SNMP, SOAP, or RESTful API over HTTP.

In the technical solution provided in this embodiment, a managementdevice configures a flow effective time parameter and a route related tothe flow effective time parameter, and sends the flow effective timeparameter and the route related to the flow effective time parameter toa first network device. Therefore, centralized configuration andautomatic dissemination of flow effective time parameter information areimplemented in a network architecture scenario based on separatedcontrol and forwarding.

FIG. 8 is a schematic diagram of a structure of an application scenarioaccording to an embodiment of this application. FIG. 8 shows anapplication manner of using an extended BGP update message to carry aflow effective time parameter in an Anti-DDOS inter-domain FlowSpecinjection scenario.

A network shown in FIG. 8 includes an Internet, a service providernetwork, and an enterprise or an Internet data center (IDC). A commonuser PC5 accesses a server in the enterprise or the IDC by means of a BRR1 of the Internet, BRs R2 and R3 in the service provider network, a BRR5 in the enterprise or the IDC, the firewall (FW), and an intrusionprevention system (IPS). Attackers PC1, PC2, PC3 and PC4 may initiate amultipoint attack from different locations. The attackers PC1 to PC4perform a traffic attack to the server in the enterprise or the IDC bymeans of the R1, R2, R3, R5, FW, and IPS.

When the server in the enterprise or the IDC is under a DDOS attack, theIPS or the FW detects attack traffic and generates an attack trafficcontrol policy. Because the attack traffic comes from multiple pointsPC1, PC2, PC3, and PC4, duration of each attack point may differ. Whenthe attack traffic control policy is configured, a duration type in theflow effective time parameter may be set to becoming invalid during idletime. If becoming invalid during idle time is set to 30 minutes, itindicates that the attack stops if the attack traffic is not detected inthe 30 minutes, and the attack traffic control policy becomes invalid.The IPS or the FW sends the flow effective time parameter (a start timetype: immediate, the duration type: becoming invalid during idle time)and a route related to the flow effective time parameter to the R5. TheR5 processes, according to the flow effective time parameter, attacktraffic corresponding to the route related to the flow effective timeparameter. In addition, the R5 generates an extended BGP update message.The extended BGP update message carries the flow effective timeparameter and the route related to the flow effective time parameter.The R5 and the R3 establish an EBGP session and the R5 sends theextended BGP update message to the R3. After receiving the extended BGPupdate message, the R3 processes, according to the flow effective timeparameter, the attack traffic corresponding to the route related to theflow effective time parameter, and disseminates the extended BGP updatemessage to the R4 and the R2. The R2 uses the same operation manner todisseminate the extended BGP update message to the R1. In this way, withdissemination of the extended BGP update message, the attack traffic issequentially controlled and blocked on the R5, R3, R4, R2, and R1. Inthe case of becoming invalid during idle time, that is, when the attacktraffic is blocked or stopped, routes through the R5, R3, R4, R2, and R1sequentially become invalid. Each BR may proactively cancel, based on aconfigured flag of canceling an invalid route, its own already invalidroute, or may receive a message of canceling an invalid route from theIPS or the FW to passively cancel the already invalid route.

FIG. 9 is a schematic diagram of a structure of a first network device900 according to an embodiment of the present application. The firstnetwork device 900 shown in FIG. 9 may perform corresponding stepsperformed by the first network device in the foregoing methodembodiment. As shown in FIG. 9, the first network device 900 includes anobtaining unit 902, a processing unit 904, and a sending unit 906.

The obtaining unit 902 is configured to obtain a flow effective timeparameter and a route related to the flow effective time parameter. Theflow effective time parameter includes a start time value and a durationvalue. The flow effective time parameter is used to indicate that theroute related to the flow effective time parameter is effective in atime interval specified by the flow effective time parameter.

The processing unit 904 is configured to process, in the specified timeinterval, service traffic corresponding to the route related to the floweffective time parameter, and generate a route control message. Theroute control message carries the flow effective time parameter and theroute related to the flow effective time parameter.

The sending unit 906 is configured to send the route control message toa second network device.

Optionally, obtaining a flow effective time parameter and a routerelated to the flow effective time parameter includes receiving, by theobtaining unit 902, the flow effective time parameter and the routerelated to the flow effective time parameter from a management device.

Optionally, the flow effective time parameter further includes a starttime type. The start time type is immediate, delayed, or scheduled. Whenthe start time type is immediate, a start moment of the specified timeinterval is a moment at which the processing unit starts processing theroute control message. When the start time type is delayed, the floweffective time parameter further includes a delay value, and a startmoment of the specified time interval is the start time value plus thedelay value. When the start time type is scheduled, a start moment ofthe specified time interval is the start time value.

Optionally, the flow effective time parameter further includes aduration type. The duration type is keeping effective, absolutelybecoming invalid, or becoming invalid during idle time. When theduration type is keeping effective, the duration value is an invalidvalue. When the duration type is absolutely becoming invalid, an endmoment of the specified time interval is the start moment of thespecified time interval plus the duration value. When the duration typeis becoming invalid during idle time, an end moment of the specifiedtime interval is a moment when time at which the processing unit doesnot process the service traffic corresponding to the route related tothe flow effective time parameter reaches the duration value.

Optionally, the flow effective time parameter further includes aduration type and a period value. The duration type is absolutelybecoming invalid. The period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period. The period valueis greater than or equal to the duration value. A start moment ofperiodically becoming effective is the start time value or the moment atwhich the processing unit 904 starts processing the route controlmessage. Each period interval of periodically becoming effectiveincludes the specified time interval. The start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective. Duration of the specified time interval is theduration value.

Optionally, the route control message further includes at least one ofthe parameters such as a flow ID, flow description, flow creation time,or a flag of canceling an invalid route.

Optionally, the route control message is an extended BGP update message.The extended BGP update message includes NLRI. The NLRI carries theroute related to the flow effective time parameter. The flow effectivetime parameter is used to indicate that the route related to the floweffective time parameter is effective in the specified time interval.

Optionally, the extended BGP update message includes a flow extensionattribute. The flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter. The flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field. The flow effective time type field isused to indicate a type of the flow effective time field. The firstlength field is used to indicate a length of the flow effective timefield. The start time value field is used to carry the start time value.The duration value field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field. The starttime type field is used to indicate immediate, delayed, or scheduled.The duration type field is used to indicate keeping effective,absolutely becoming invalid, or becoming invalid during idle time. Thedelay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field. The period value field is used to carry the period value.

Optionally, the flow extension attribute further includes a flow IDfield. The flow ID field includes a flow ID type field, a second lengthfield, an AS ID field, a router ID field, and a flow ID value field. Theflow ID type field is used to indicate a type of the flow ID field. Thesecond length field is used to indicate a length of the flow ID field.The AS ID field is used to indicate an AS in which the first networkdevice is located. The router ID field is used to identify the firstnetwork device. The flow ID value field is used to carry the flow ID.

Optionally, the flow extension attribute further includes a flowdescription field. The flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field. The flow description type field is used to indicate a typeof the flow description field. The third length field is used toindicate a length of the flow description field. The flow descriptionvalue field is used to carry the flow description.

Optionally, the flow extension attribute further includes a flowcreation time field. The flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field. The flow creation time type field is used to indicatea type of the flow creation time field. The fourth length field is usedto indicate a length of the flow creation time field. The flow creationtime value field is used to carry a flow creation time value.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

The first network device 900 shown in FIG. 9 may perform correspondingsteps performed by the first network device in the foregoing methodembodiment. Therefore, a flow effective time parameter is automaticallydisseminated among multiple network devices, a limited-time effectiverequirement for a traffic control policy is met, configuration workloadis reduced, and maintenance difficulty is lowered.

FIG. 10 is a schematic diagram of a hardware structure of a firstnetwork device 1000 according to an embodiment of the presentapplication. The first network device 1000 shown in FIG. 10 may performcorresponding steps performed by the first network device in theforegoing method embodiment. Optionally, the first network device 1000may be a BR. The BR may be a network forwarding device such as a routeror a switch having layer-3 functions.

As shown in FIG. 10, the first network device 1000 includes a processor1001, a memory 1002, an interface 1003, and a bus 1004. The interface1003 may be implemented in a wireless or wired manner, and may be acomponent, such as a network interface card. The processor 1001, thememory 1002 and the interface 1003 are connected using the bus 1004.

The interface 1003 may include a sender and a receiver, which areconfigured to support sending and receiving information between thefirst network device and the second network device and a controller inthe foregoing embodiment. For example, the interface 1003 is configuredto support steps S102 and S106 in the process shown in FIG. 1. Theprocessor 1001 is configured to perform the processing process relatedto the first network device shown in FIG. 1 and/or another processrelated to the technology described in this application. For example,the processor 1001 is configured to support steps S102 and S104 in theprocess shown in FIG. 1. The memory 1002 is configured to store programcode and data of the first network device 1000.

It may be understood that FIG. 10 shows only a simplified design of thefirst network device 1000. During actual application, the first networkdevice 1000 may include any quantities of interfaces 1003, processors1001, memories 1002, and the like. All first network devices that canimplement the present application fall within the protection scope ofthe present application.

FIG. 11 is a schematic diagram of a structure of a second network device1100 according to an embodiment of the present application. The secondnetwork device 1100 shown in FIG. 11 may perform corresponding stepsperformed by the second network device in the foregoing methodembodiment. As shown in FIG. 11, the second network device 1100 includesa receiving unit 1102, a processing unit 1104, and a sending unit 1106.

The receiving unit 1102 is configured to receive a route control messagefrom a first network device. The route control message carries a floweffective time parameter and a route related to the flow effective timeparameter. The flow effective time parameter includes a start time valueand a duration value. The flow effective time parameter is used toindicate that the route related to the flow effective time parameter iseffective in a time interval specified by the flow effective timeparameter.

The processing unit 1104 is configured to process, in the specified timeinterval, service traffic corresponding to the route related to the floweffective time parameter.

The sending unit 1106 is configured to send the route control message toother network devices. The other network devices do not include thefirst network device.

Optionally, the flow effective time parameter further includes a starttime type. The start time type is immediate, delayed, or scheduled. Whenthe start time type is immediate, a start moment of the specified timeinterval is a moment at which the processing unit starts processing theroute control message. When the start time type is delayed, the floweffective time parameter further includes a delay value, and a startmoment of the specified time interval is the start time value plus thedelay value. When the start time type is scheduled, a start moment ofthe specified time interval is the start time value.

Optionally, the flow effective time parameter further includes aduration type. The duration type is keeping effective, absolutelybecoming invalid, or becoming invalid during idle time. When theduration type is keeping effective, the duration value is an invalidvalue. When the duration type is absolutely becoming invalid, an endmoment of the specified time interval is the start moment of thespecified time interval plus the duration value. When the duration typeis becoming invalid during idle time, an end moment of the specifiedtime interval is a moment when time at which the processing unit 1104does not process the service traffic corresponding to the route relatedto the flow effective time parameter reaches the duration value.

Optionally, the flow effective time parameter further includes aduration type and a period value. The duration type is absolutelybecoming invalid. The period value is used to indicate that the routerelated to the flow effective time parameter periodically becomeseffective and is used to indicate a length of a period. The period valueis greater than or equal to the duration value. A start moment ofperiodically becoming effective is the start time value or the moment atwhich the processing unit 1104 starts processing the route controlmessage. Each period interval of periodically becoming effectiveincludes the specified time interval. The start moment of the specifiedtime interval is a start moment of each period interval of periodicallybecoming effective. Duration of the specified time interval is theduration value.

Optionally, the second network device 1100 further includes amodification unit (not shown) configured to modify the flow effectivetime parameter.

Optionally, the route control message further includes at least one ofthe parameters such as a flow ID, flow description, flow creation time,or a flag of canceling an invalid route.

Optionally, the route control message is an extended BGP update message.The extended BGP update message includes NLRI. The NLRI carries theroute related to the flow effective time parameter. The flow effectivetime parameter is used to indicate that the route related to the floweffective time parameter is effective in the specified time interval.

Optionally, the extended BGP update message includes a flow extensionattribute. The flow extension attribute includes a flow effective timefield, and the flow effective time field is used to carry the floweffective time parameter. The flow effective time field includes a floweffective time type field, a first length field, a start time valuefield, and a duration value field. The flow effective time type field isused to indicate a type of the flow effective time field. The firstlength field is used to indicate a length of the flow effective timefield. The start time value field is used to carry the start time value.The duration value field is used to carry the duration value.

Optionally, the flow effective time field further includes a start timetype field, a duration type field, and a delay value field. The starttime type field is used to indicate immediate, delayed, or scheduled.The duration type field is used to indicate keeping effective,absolutely becoming invalid, or becoming invalid during idle time. Thedelay value field is used to carry the delay value.

Optionally, the flow effective time field further includes a periodvalue field. The period value field is used to carry the period value.

Optionally, the flow extension attribute further includes a flow IDfield. The flow ID field includes a flow ID type field, a second lengthfield, an AS ID field, a router ID field, and a flow ID value field. Theflow ID type field is used to indicate a type of the flow ID field. Thesecond length field is used to indicate a length of the flow ID field.The AS ID field is used to indicate an AS in which the first networkdevice is located. The router ID field is used to identify the firstnetwork device. The flow ID value field is used to carry the flow ID.

Optionally, the flow extension attribute further includes a flowdescription field. The flow description field includes a flowdescription type field, a third length field, and a flow descriptionvalue field. The flow description type field is used to indicate a typeof the flow description field. The third length field is used toindicate a length of the flow description field. The flow descriptionvalue field is used to carry the flow description.

Optionally, the flow extension attribute further includes a flowcreation time field. The flow creation time field includes a flowcreation time type field, a fourth length field, and a flow creationtime value field. The flow creation time type field is used to indicatea type of the flow creation time field. The fourth length field is usedto indicate a length of the flow creation time field. The flow creationtime value field is used to carry a flow creation time value.

Optionally, the flow extension attribute further includes a flag fieldof canceling an invalid route.

The second network device 1100 shown in FIG. 11 may performcorresponding steps performed by the second network device in theforegoing method embodiment. Therefore, a flow effective time parameteris automatically disseminated among multiple network devices, alimited-time effective requirement for a traffic control policy is met,configuration workload is reduced, and maintenance difficulty islowered.

FIG. 12 is a schematic diagram of a hardware structure of a secondnetwork device 1200 according to an embodiment of the presentapplication. The second network device 1200 shown in FIG. 12 may performcorresponding steps performed by the second network device in theforegoing method embodiment. Optionally, the second network device 1200may be a BR. The BR may be a network forwarding device such as a routeror a switch having layer-3 functions.

As shown in FIG. 12, the second network device 1200 includes a processor1201, a memory 1202, an interface 1203, and a bus 1204. The interface1203 may be implemented in a wireless or wired manner, and may be acomponent, such as a network interface card. The processor 1201, thememory 1202 and the interface 1203 are connected using the bus 1204.

The interface 1203 may further include a sender and a receiver, whichare configured to support sending and receiving information between thesecond network device and the first network device and another networkdevice in the foregoing embodiment. For example, the interface 1203 isconfigured to support steps S602 and S606 in the process shown in FIG.6. The processor 1201 is configured to perform the processing processrelated to the second network device shown in FIG. 6 and/or anotherprocess related to the technology described in this application. Forexample, the processor 1201 is configured to support step S604 in theprocess shown in FIG. 6. The memory 1202 is configured to store programcode and data of the second network device 1200.

It may be understood that FIG. 12 shows only a simplified design of thesecond network device 1200. During actual application, the secondnetwork device 1200 may include any quantities of interfaces 1203,processors 1201, memories 1202, and the like. All second network devicesthat can implement the present application fall within the protectionscope of the present application.

In addition, as shown in FIG. 13, an embodiment of the presentapplication further provides a network system 1300. The network system1300 may include the first network device provided in the embodimentcorresponding to FIG. 9 or FIG. 10 and the second network deviceprovided in the embodiment corresponding to FIG. 11 or FIG. 12. Thefirst network device and the second network device are not described indetail again herein.

Methods or algorithm steps described in combination with the contentdisclosed in the present application may be implemented by hardware, ormay be implemented by a processor by executing a software instruction.The software instruction may include a corresponding software module,and the software module may be stored in a random access memory (RAM), aflash memory, a read-only memory (ROM), an erasable programmable ROM(EPROM), an electrically EPROM (EEPROM), a register, a hard disk, aremovable hard disk, a compact disc ROM (CD-ROM), or a storage medium ofany other form well known in the art. A storage medium used as anexample is coupled to the processor such that the processor can readinformation from the storage medium, and can write information into thestorage medium. Certainly, the storage medium may be a part of theprocessor. The processor and the storage medium may be located in anapplication-specific integrated circuit (ASIC). In addition, the ASICmay be located in user equipment. Certainly, the processor and thestorage medium may exist in the user equipment as discrete components.

A person skilled in the art should be aware that in the foregoing one ormore examples, functions described in the present application may beimplemented by hardware, software, firmware, or any combination thereof.When the present application is implemented by software, the foregoingfunctions may be stored in a computer-readable medium or transmitted asone or more instructions or code in the computer-readable medium. Thecomputer-readable medium includes a computer storage medium and acommunications medium, where the communications medium includes anymedium that enables a computer program to be transmitted from one placeto another. The storage medium may be any available medium accessible toa general-purpose or dedicated computer.

The objectives, technical solutions, and benefits of the presentapplication are further described in detail in the foregoing specificembodiments. It should be understood that the foregoing descriptions aremerely specific embodiments of the present application, but are notintended to limit the protection scope of the present application. Anymodification, equivalent replacement, or improvement made based on thetechnical solutions of the present application shall fall within theprotection scope of the present application.

What is claimed is:
 1. A route processing method, implemented by a firstnetwork device, the method comprising: obtaining a flow effective timeparameter and a route related to the flow effective time parameter,wherein the flow effective time parameter comprises a start time valueand a duration value, and wherein the flow effective time parameterindicates that the route related to the flow effective time parameter iseffective in a time interval specified by the flow effective timeparameter; generating a message carrying the flow effective timeparameter and the route related to the flow effective time parameter,wherein the message indicates a second network device to process servicetraffic corresponding to the route related to the flow effective timeparameter in the specified time interval; and sending the message to thesecond network device.
 2. The route processing method of claim 1,wherein the flow effective time parameter further comprises a start timetype and a delay value, wherein the start time type comprises at leastone of the following types: immediate, delayed, or scheduled, wherein astart moment of the specified time interval comprises a moment at whichthe first network device starts processing the message when the starttime type comprises immediate, wherein the start moment of the specifiedtime interval comprises the start time value plus the delay value whenthe start time type comprises delayed, and wherein the start moment ofthe specified time interval comprises the start time value when thestart time type comprises scheduled.
 3. The route processing method ofclaim 1, wherein the flow effective time parameter further comprises aduration type comprising at least one of the following types: keepingeffective, absolutely becoming invalid, or becoming invalid during idletime, wherein the duration value comprises an invalid value when theduration type comprises keeping effective, wherein an end moment of thespecified time interval comprises a start moment of the specified timeinterval plus the duration value when the duration type comprisesabsolutely becoming invalid, and wherein the end moment of the specifiedtime interval comprises a moment when time at which the first networkdevice does not process the service traffic corresponding to the routerelated to the flow effective time parameter reaches the duration valueand when the duration type comprises becoming invalid during idle time.4. The route processing method of claim 1, wherein the flow effectivetime parameter further comprises a duration type and a period value,wherein the duration type comprises absolutely becoming invalid, whereinthe period value indicates that the route related to the flow effectivetime parameter periodically becomes effective and a length of a period,wherein the period value is greater than or equal to the duration value,wherein a start moment of periodically becoming effective comprises thestart time value or a moment at which the first network device startsprocessing the message, wherein each period interval of periodicallybecoming effective comprises the specified time interval, wherein astart moment of the specified time interval comprises a start moment ofeach period interval of periodically becoming effective, and wherein aduration of the specified time interval comprises the duration value. 5.The route processing method of claim 1, wherein the message comprises anextended border gateway protocol (BGP) update message, wherein theextended BGP update message comprises network layer reachabilityinformation (NLRI), wherein the NLRI carries the route related to theflow effective time parameter, and wherein the flow effective timeparameter indicates that the route related to the flow effective timeparameter is effective in the specified time interval.
 6. The routeprocessing method of claim 5, wherein the extended BGP update messagecomprises a flow extension attribute, wherein the flow extensionattribute comprises a flow effective time field, wherein the floweffective time field carries the flow effective time parameter, whereinthe flow effective time field comprises a flow effective time typefield, a first length field, a start time value field, and a durationvalue field, wherein the flow effective time type field indicates a typeof the flow effective time field, wherein the first length fieldindicates a length of the flow effective time field, wherein the starttime value field carries the start time value, and wherein the durationvalue field carries the duration value.
 7. The route processing methodof claim 6, wherein the flow effective time field further comprises astart time type field, a duration type field, and a delay value field,wherein the start time type field indicates at least one of thefollowing types: immediate, delayed, or scheduled, wherein the durationtype field indicates at least one of the following types: keepingeffective, absolutely becoming invalid, or becoming invalid during idletime, and wherein the delay value field carries a delay value.
 8. Theroute processing method of claim 6, wherein the flow effective timefield further comprises a period value field, and wherein the periodvalue field carries a period value.
 9. The route processing method ofclaim 6, wherein the flow extension attribute further comprises a flowidentifier (ID) field, wherein the flow ID field comprises a flow IDtype field, a second length field, an autonomous system (AS) ID field, arouter ID field, and a flow ID value field, wherein the flow ID typefield indicates a type of the flow ID field, wherein the second lengthfield indicates a length of the flow ID field, wherein the AS ID fieldindicates an AS in which the first network device is located, whereinthe router ID field identifies the first network device, and wherein theflow ID value field carries a flow ID.
 10. The route processing methodof claim 6, wherein the flow extension attribute further comprises aflow description field, wherein the flow description field comprises aflow description type field, a third length field, and a flowdescription value field, wherein the flow description type fieldindicates a type of the flow description field, wherein the third lengthfield indicates a length of the flow description field, and wherein theflow description value field carries a flow description.
 11. The routeprocessing method of claim 6, wherein the flow extension attributefurther comprises a flag field of cancelling an invalid route.
 12. Theroute processing method of claim 1, further comprising processing, bythe first network device in the specified time interval, service trafficcorresponding to the route related to the flow effective time parameter.13. A route processing method, comprising: receiving, by a secondnetwork device, a message from a first network device, wherein themessage carries a flow effective time parameter and a route related tothe flow effective time parameter, wherein the flow effective timeparameter comprises a start time value and a duration value, and whereinthe flow effective time parameter indicates that the route related tothe flow effective time parameter is effective in a time intervalspecified by the flow effective time parameter; and processing, by thesecond network device in the specified time interval, service trafficcorresponding to the route related to the flow effective time parameteraccording to the message.
 14. The route processing method of claim 13,wherein the flow effective time parameter further comprises a start timetype and a delay value, wherein the start time type comprises at leastone of the following types: immediate, delayed, or scheduled, wherein astart moment of the specified time interval comprises a moment at whichthe second network device starts processing the message when the starttime type comprises immediate, wherein the start moment of the specifiedtime interval comprises the start time value plus the delay value whenthe start time type comprises delayed, and wherein the start moment ofthe specified time interval comprises the start time value when thestart time type comprises scheduled.
 15. The route processing method ofclaim 13, wherein the flow effective time parameter further comprises atleast one of the following types: a duration type, wherein the durationtype comprises keeping effective, absolutely becoming invalid, orbecoming invalid during idle time, wherein the duration value comprisesan invalid value when the duration type comprises keeping effective,wherein an end moment of the specified time interval comprises a startmoment of the specified time interval plus the duration value when theduration type comprises absolutely becoming invalid, and wherein the endmoment of the specified time interval comprises a moment when time atwhich the second network device does not process the service trafficcorresponding to the route related to the flow effective time parameterreaches the duration value and when the duration type comprises becominginvalid during idle time.
 16. The route processing method of claim 13,wherein the flow effective time parameter further comprises a durationtype and a period value, wherein the duration type comprises absolutelybecoming invalid, wherein the period value indicates that the routerelated to the flow effective time parameter periodically becomeseffective and a length of a period, wherein the period value is greaterthan or equal to the duration value, wherein a start moment ofperiodically becoming effective comprises the start time value or amoment at which the second network device starts processing the message,wherein each period interval of periodically becoming effectivecomprises the specified time interval, wherein a start moment of thespecified time interval comprises a start moment of each period intervalof periodically becoming effective, and wherein a duration of thespecified time interval comprises the duration value.
 17. The routeprocessing method of claim 13, further comprising sending the message toother network devices, wherein the other network devices do not comprisethe first network device.
 18. A first network device, comprising: anon-transitory memory storing instructions; and a processor coupled tothe non-transitory memory, wherein the instructions cause the processorto be configured to: obtain a flow effective time parameter and a routerelated to the flow effective time parameter, wherein the flow effectivetime parameter comprises a start time value and a duration value, andwherein the flow effective time parameter indicates that the routerelated to the flow effective time parameter is effective in a timeinterval specified by the flow effective time parameter; generate amessage, wherein the message carries the flow effective time parameterand the route related to the flow effective time parameter, wherein themessage indicates a second network device to process service trafficcorresponding to the route related to the flow effective time parameterin the specified time interval; and send the message to the secondnetwork device.
 19. The first network device of claim 18, wherein theflow effective time parameter further comprises a start time type and adelay value, wherein the start time type comprises at least one of thefollowing types: immediate, delayed, or scheduled, wherein a startmoment of the specified time interval comprises a moment at which theprocessor starts processing the message when the start time typecomprises immediate, wherein the start moment of the specified timeinterval comprises the start time value plus the delay value when thestart time type comprises delayed, and wherein the start moment of thespecified time interval comprises the start time value when the starttime type comprises scheduled.
 20. The first network device of claim 18,wherein the flow effective time parameter further comprises a durationtype, wherein the duration type comprises at least one of the followingtypes: keeping effective, absolutely becoming invalid, or becominginvalid during idle time, wherein the duration value comprises aninvalid value when the duration type comprises keeping effective,wherein an end moment of the specified time interval comprises a startmoment of the specified time interval plus the duration value when theduration type comprises absolutely becoming invalid, and wherein the endmoment of the specified time interval comprises a moment when time atwhich the processor does not process the service traffic correspondingto the route related to the flow effective time parameter reaches theduration value and when the duration type comprises becoming invalidduring idle time.
 21. The first network device of claim 18, wherein theflow effective time parameter further comprises a duration type and aperiod value, wherein the duration type comprises absolutely becominginvalid, wherein the period value indicates that the route related tothe flow effective time parameter periodically becomes effective and alength of a period, wherein the period value is greater than or equal tothe duration value, wherein a start moment of periodically becomingeffective comprises the start time value or a moment at which theprocessor starts processing the message, wherein each period interval ofperiodically becoming effective comprises the specified time interval,wherein a start moment of the specified time interval comprises a startmoment of each period interval of periodically becoming effective, andwherein a duration of the specified time interval is the duration value.22. The first network device of claim 18, wherein the message comprisesan extended border gateway protocol (BGP) update message, wherein theextended BGP update message comprises network layer reachabilityinformation (NLRI), wherein the NLRI carries the route related to theflow effective time parameter, and wherein the flow effective timeparameter indicates that the route related to the flow effective timeparameter is effective in the specified time interval.
 23. The firstnetwork device of claim 22, wherein the extended BGP update messagecomprises a flow extension attribute, wherein the flow extensionattribute comprises a flow effective time field, wherein the floweffective time field carries the flow effective time parameter, whereinthe flow effective time field comprises a flow effective time typefield, a first length field, a start time value field, and a durationvalue field, wherein the flow effective time type field indicates a typeof the flow effective time field, wherein the first length fieldindicates a length of the flow effective time field, wherein the starttime value field carries the start time value, and wherein the durationvalue field carries the duration value.
 24. The first network device ofclaim 23, wherein the flow effective time field further comprises astart time type field, a duration type field, and a delay value field,wherein the start time type field indicates at least one of thefollowing types: immediate, delayed, or scheduled, and wherein theduration type field indicates at least one of the following types:keeping effective, absolutely becoming invalid, or becoming invalidduring idle time, and wherein the delay value field carries a delayvalue.
 25. The first network device of claim 23, wherein the flowextension attribute further comprises a flow identifier (ID) field,wherein the flow ID field comprises a flow ID type field, a secondlength field, an autonomous system (AS) ID field, a router ID field, anda flow ID value field, wherein the flow ID type field indicates a typeof the flow ID field, wherein the second length field indicates a lengthof the flow ID field, wherein the AS ID field indicates an AS in whichthe first network device is located, wherein the router ID fieldidentifies the first network device, and wherein the flow ID value fieldcarries a flow ID.
 26. A second network device, comprising: anon-transitory memory storing instructions; and a processor coupled tothe non-transitory memory, wherein the instructions cause the processorto be configured to: receive a message from a first network device,wherein the message carries a flow effective time parameter and a routerelated to the flow effective time parameter, wherein the flow effectivetime parameter comprises a start time value and a duration value, andwherein the flow effective time parameter indicates that the routerelated to the flow effective time parameter is effective in a timeinterval specified by the flow effective time parameter; and process, inthe specified time interval, service traffic corresponding to the routerelated to the flow effective time parameter according to the message.27. The second network device of claim 26, wherein the flow effectivetime parameter further comprises a start time type and a delay value,wherein the start time type comprises at least one of the followingtypes: immediate, delayed, or scheduled, wherein a start moment of thespecified time interval comprises a moment at which the processor startsprocessing the message when the start time type comprises immediate,wherein the start moment of the specified time interval comprises thestart time value plus the delay value when the start time type comprisesdelayed, and wherein the start moment of the specified time intervalcomprises the start time value when the start time type comprisesscheduled.
 28. The second network device of claim 26, wherein the floweffective time parameter further comprises a duration type, wherein theduration type comprises at least one of the following types: keepingeffective, absolutely becoming invalid, or becoming invalid during idletime, wherein the duration value comprises an invalid value when theduration type comprises keeping effective, wherein an end moment of thespecified time interval comprises a start moment of the specified timeinterval plus the duration value when the duration type comprisesabsolutely becoming invalid, and wherein the end moment of the specifiedtime interval comprises a moment when time at which the processor doesnot process the service traffic corresponding to the route related tothe flow effective time parameter reaches the duration value when theduration type comprises becoming invalid during idle time.
 29. Thesecond network device of claim 26, wherein the flow effective timeparameter further comprises a duration type and a period value, whereinthe duration type comprises absolutely becoming invalid, wherein theperiod value indicates that the route related to the flow effective timeparameter periodically becomes effective and a length of a period,wherein the period value is greater than or equal to the duration value,wherein a start moment of periodically becoming effective comprises thestart time value or a moment at which the processor starts processingthe message, wherein each period interval of periodically becomingeffective comprises the specified time interval, wherein a start momentof the specified time interval comprises a start moment of each periodinterval of periodically becoming effective, and wherein a duration ofthe specified time interval comprises the duration value.
 30. The secondnetwork device of claim 26, wherein the instructions further cause theprocessor to be configured to send the message to other network devices,and wherein the other network devices do not comprise the first networkdevice.